import * as actions from '../actions/index';

// 页面初始化数据
export const initialState = {
  isPostingService: false,
  data: {},
  isLoadingService: true,
  ruleData: {},
  // 展开的检测项
  expandKeys: [],
};
const defaultAction = {
  type: 'doNothing',
};

export default function index(state = initialState, action = defaultAction) {
  switch (action.type) {
    case actions.UPDATE_DATA:
      return { ...state, ...action.data };
    case actions.RESET_DATA:
      return { ...initialState };
    default:
      return state;
  }
}
